package protocol;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;

@SuppressWarnings("serial")
public class Protocol implements Serializable {
	private Command cmd;
	private Object obj;

	public Protocol(Command cmd, Object obj) {
		this.cmd = cmd;
		this.obj = obj;
	}

	public Command getCmd() {
		return cmd;
	}

	public void setCmd(Command cmd) {
		this.cmd = cmd;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public void sendMe(ObjectOutputStream out) throws IOException {
		out.writeObject(this);
		out.reset();
	}
}
